Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(import): Add support for reading skipped paths from logfile #4387

Merged
merged 4 commits into from
Jun 29, 2022

Conversation

Holzhaus
Copy link
Contributor

@Holzhaus Holzhaus commented Jun 26, 2022

Description

Fixes #4379.

To Do

  • Documentation. (If you've add a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst near the top of the document.)
  • Test. (Encouraged but not strictly required.)

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool; thank you for looking into this!

If it doesn't seem overly complex to implement, I think I'd prefer to use an explicit command-line flag (like beet import --read-log foo.log) as opposed to implicitly allowing logs as arguments alongside files/directories. The main benefit would be that it will be more "debuggable" from the perspective of the user: if the log file isn't want they expect or is malformed, they can get a useful error message instead of letting the text file be treated as a media file. I hope this makes sense!

beets/ui/commands.py Outdated Show resolved Hide resolved
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
@Holzhaus Holzhaus force-pushed the import-from-logfile branch 2 times, most recently from 999b960 to 47cb273 Compare June 27, 2022 20:20
Copy link
Contributor Author

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't seem overly complex to implement, I think I'd prefer to use an explicit command-line flag (like beet import --read-log foo.log) as opposed to implicitly allowing logs as arguments alongside files/directories.

Done. I also added a small test for the helper function.

Sorry for the force-pushing, I abused git as a way to deploy the code on my NAS (so I can test it on my library). Also don't have windows so I had to use the CI for trial and error test driven development ;-)

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; thanks for taking this "flag" approach! I think this is basically there—I have one or two very low-level comments for your consideration.

beets/ui/commands.py Outdated Show resolved Hide resolved
beets/ui/commands.py Show resolved Hide resolved
beets/ui/commands.py Outdated Show resolved Hide resolved
@Holzhaus
Copy link
Contributor Author

ready to review

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great. Thanks for the fast and clean work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow importing from logfile
2 participants